import request from '@/utils/request'

// 查询
export function listOrders(query) {
  return request({
    url: '/service/procurement/contract/list',
    method: 'get',
    params: query
  })
}

// 查询
export function getOrders(id) {
  return request({
    url: '/service/procurement/contract/' + id,
    method: 'get'
  })
}

// 新增
export function addOrders(data) {
  return request({
    url: '/service/procurement/contract',
    method: 'post',
    data: data
  })
}

// 修改
export function updateOrders(data) {
  return request({
    url: '/service/procurement/contract',
    method: 'put',
    data: data
  })
}

// 获取运费信息
export function getCarriageInfo(id) {
  return request({
    url: '/service/carriage/' + id,
    method: 'get',
  })
}
// 运费修改
export function changeCarriage(data) {
  return request({
    url: '/service/carriage',
    method: 'post',
    data: data
  })
}

// 历史运费查询
export function getCarriageHistory(query) {
  return request({
    url: '/service/carriage/list',
    method: 'get',
    params: query
  })
}

// 账号管理列表
export function supplierAccount(id) {
  return request({
    url: '/service/carrier/account/' + id,
    method: 'get',
  })
}

// 添加主账号
export function addMainAccount(data) {
  return request({
    url: '/service/carrier/account',
    method: 'POST',
    data: data
  })
}

// 修改账号
export function changeAccount(data) {
  return request({
    url: '/service/carrier/account',
    method: 'PUT',
    data: data
  })
}


// 添加子账号
export function addSunAccount(data) {
  return request({
    url: '/service/carrier/subAccount',
    method: 'POST',
    data: data
  })
}

// 删除子账号
export function deleteSunAccount(id) {
  return request({
    url: '/service/carrier/account/' + id,
    method: 'DELETE',
  })
}